<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../../common/header.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DSP</title>
<%@include file="../../common/link.jsp"%>
</head>
<script>
	var config = {
		url : 'tags'
	}
	var colModel = [{
		title : '标签',
		field : 'tagId',
		width : 60,
		align : 'left',
		formatter:function(value,rowData,rowIndex){
			return "<a href='#' onclick='javascript:DSP.update("+rowData.id+");'>"+value+"</a>";
		}
	}, {
		title : '显示名称',
		field : 'tagName',
		width : 110,
		//sortable : true,
		align : 'left'
	}, {
		title : '显示值',
		field : 'tagValue',
		width : 30,
		//sortable : true,
		align : 'left' 
	}, {
		title : '默认值',
		field : 'tagDefault',
		width : 60,
		//sortable : true,
		align : 'center',
		formatter:function(cell ,row , dataIndex){
			return cell == 1 ? '是' :'否';
		}
	}];
	function update(data){
		$_("id").value = data.id;
		$_("tagId").value= data.tagId;
		$_("tagName").value=data.tagName;
		$_("tagValue").value=data.tagValue;
		//$_("tagDefault").value=data.tagDefault;
		DSP.setRadio("tagDefault",data.tagDefault);
	}
</script>
<body>
<form id="qForm">
		<table width="60%" cellspacing="3" cellpadding="3"
			bordercolor="#DEDEDC" border="0" id="q-form" >
			<tr>
				<th width="15%" class="td_left" valign="middle">标签代码:</th>
				<td width="20%"><input type="text" name="q_tagId" id="q_tagId" />
				</td>
				<th width="15%" class="td_left" valign="middle">显示名称:</th>
				<td width="20%"><input type="text" name="q_tagName" id="q_tagName" />
				</td>
			</tr>
		</table>
		</form>
	<div id="dialog_div" class="easyui-window" title="参数配置" collapsible="false" minimizable="false" maximizable="false"
		icon="icon-save" style="width: 310px; height: 600px; left: 200px; top: 10px; padding: 5px; background: #fafafa;">
		<div class="easyui-layout" fit="true">
			<div region="center" border="false"
				style="padding: 10px; background: #fff; border: 1px solid #ccc;">
				<form action="" id="form1" onsubmit="return false;">
					<input type="hidden" name="id" id="id" value="" /> 
					<table width="100%" cellspacing="3" cellpadding="3"
						bordercolor="#DEDEDC" border="0" id="id-form">
							<tr>
								<th>标签:</th>
								<td><input type="text" name="tagId" id="tagId" 
								jval="{valid:function(val){if (val.length == 0) return '标签不能为空'; else return '';}}"
									/></td>
							</tr>
							<tr>
								<th>显示名称:</th>
								<td><input type="text" name="tagName" id="tagName" 
								 jval="{valid:function(val){if (val.length ==0) return '显示名称不能为空'; else return '' }}"
									maxlength="100" />
								</td>
							</tr>
							<tr>
								<th>显示值 :</th>
								<td><input type="text" name="tagValue" id="tagValue" 
								jval="{valid:function(val){ if (val.length==0) return '显示值不能为空' ; else return '';}}"/>
								</td>
							</tr>
							<tr>
								<th>默认值 :</th>
								<td><dsp:radioTag htmlId="tagDefault" tagId="chk"  htmlValue=""></dsp:radioTag> 
								</td>
							</tr>
							</table>
				</form>
			</div>
			<div region="south" border="false"
				style="text-align: right; height: 30px; line-height: 30px;">
				<a id="btnEp" class="easyui-linkbutton" icon="icon-ok" href="javascript:DSP.send();"> 确定</a> 
				<a id="btnCancel" class="easyui-linkbutton" icon="icon-cancel" href="javascript:DSP.close();">取消</a>
			</div>
		</div>
	</div>
	<table id="xDataGrid"></table>
	<script type="text/javascript">
		$(function() {
			DSP.open(false,220,400,"");
			DSP.grid(colModel, false ,null,"参数配置");
			//监听查询输入框事件
			$("#qForm input").keyup(function(event){
				var e = event || window.event; //浏览器兼容
				if(e.keyCode == 13){ 
					 DSP.grid.query();
				}
			});
		});
	</script>
</body>
</html>
